#ifndef __MY_SQL_PARSE_H__
#define __MY_SQL_PARSE_H__
#include <sql/mysql_priv.h>
#include <mysql.h>
#include <libmysqld/embedded_priv.h>
#include <sql/sp_head.h>
#include "parser_base.h"
#include <string>

class CSqlParser : public IParser
{
public:
	CSqlParser();
	virtual ~CSqlParser();
public:
	bool Init();
	void End();
	Result Parse(Context* ctx);
	THD* MyTHD();
	const std::string&
		SqlSign() 
	{
		return m_sSQL;
	}
private:
	bool ParseSingle(Context* ctx, char *rawbuf, 
		uint length, const char** found_semicolon,
		Result& ret);
	
private:
	bool m_bInit;
	THD*		m_pTHD;
	std::string m_sSQL;
};
#endif
